import {get,post} from './http'

//注册
export let reqRegister = (params) => post("/api/register",params)
//登录
export let reqLogin = (params)=> post("/api/login",params)

//新人专享

export let getNew = () => get("/api/getnew")

// 倒计时
export let reqGetcountdown =()=>get("/api/getcountdown")

//秒杀

export let getKill = ()=>get("/api/getseckill")

// 首页商品信息
export let getIndexGoods = ()=>get("/api/getindexgoods")

//获取商品分类
export let getCate = ()=>get("api/getcate")
//获取分类商品
export let getGoods = (params)=>get("api/getgoods",params)
//获取商品信息
export let getInfo = (params)=>get("api/getgoodsinfo",params)

//购物车添加
export let reqCartadd = (id)=> post("/api/cartadd",{
    goodsid:id,
    type:1,
    num:1,
    uid:JSON.parse(sessionStorage.getItem("userInfo")).uid
})

//购物车列表
export let getCateList = ()=>get("/api/cartlist",{
    uid:JSON.parse(sessionStorage.getItem("userInfo")).uid
})

//购物车删除
export let reqDelCate = (params)=>post("/api/cartdelete",params)
//购物车修改
export let reqEditCate = (params)=>post("/api/cartedit",params)

//轮播图信息
export let reqGetBanner = ()=>get("/api/getbanner")

 